<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <tmpl>
        <!-- 获取子组件中data的数据-->
        <!-- template绑定slot，子组件slot绑定中data数据-->
        <!-- <template slot-scope="slot">-->
        <!-- vue2.6.0+语法, v-slot不能省略 -->
        <template v-slot:default="slot">
            <span>{{slot.lang}}</span>
        </template>
    </tmpl>
</div>
<template id="tepl">
    <div>
        <slot :lang="pLang">
            <ul>
                <li v-for="item in pLang">{{item}}</li>
            </ul>
        </slot>
    </div>
</template>
<!--<script src="js/vue-2.5.16.js"></script>-->
<script src="js/vue-2.6.11.js"></script>
<script>
    const app = new Vue({
        el: "#app",
        data: {},
        components: {
            tmpl: {
                template: '#tepl',
                data() {
                    return {
                        pLang: ["python", "java", "c++", "go"]
                    }
                }
            }
        },
        methods: {}
    })
</script>
</body>
</html>